/*
 ID: cherish2
 LANG: JAVA
 PROG: friday
 */

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class friday {
	
	private static int[] mtab = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	//the year is a leap year.
	private static int isLeap(int year){
		if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
			return 1;
		}else{
			return 0;
		}			
	}
	
	private static int mlen(int year, int month){		
		if(month == 2){
			return mtab[month - 1] + isLeap(year);
		}else{
			return mtab[month - 1];
		}	
	}

	public static void main(String[] args) throws IOException {

		BufferedReader reader = new BufferedReader(new FileReader("friday.in"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"friday.out")));

		String text = reader.readLine();
		int N = Integer.parseInt(text);
		int year = 1900 + N - 1;

		 
		int[] ndow = new int[7];
		for(int i = 0; i < 7; i++){
			ndow[i] = 0;
		}
		
		int dow = 0; // day of week: January 13, 1900 was a Saturday = 0 
		for (int i = 1900; i <= year; i++) {			
			for(int m = 1; m <=12; m++){
				ndow[dow]++;
				dow = (dow+mlen(i, m)) % 7;	//the day of the next month			
			}
		}
		for(int i = 0; i < ndow.length; i++){
			if(i == ndow.length - 1){
				out.println(ndow[i]);
			}else{
				out.print(ndow[i] + " ");
			}
		}
		
		out.close();
		System.exit(0);
	}
}
